-- GENERATED SPELL FOR [Tenebron] --


function spell0_30452(pUnit, Event) --@Hatch Eggs,n/a--
pUnit:FullCastSpellOnTarget(58542,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_30452', 5000, 1)
end

function spell1_30452(pUnit, Event) --@Hatch Eggs,Self--
pUnit:FullCastSpellOnTarget(58793,pUnit)
pUnit:RegisterEvent('Sorts_30452', 2500, 1)
end

function spell2_30452(pUnit, Event) --@Hatch Eggs,n/a--
pUnit:FullCastSpellOnTarget(59189,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_30452', 2500, 1)
end

function spell3_30452(pUnit, Event) --@Power of Tenebron,n/a--
pUnit:FullCastSpellOnTarget(61248,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_30452', 547, 1)
end

function spell4_30452(pUnit, Event) --@Shadow Breath,n/a--
pUnit:FullCastSpellOnTarget(57570,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_30452', 646, 1)
end

function spell5_30452(pUnit, Event) --@Shadow Breath,n/a--
pUnit:FullCastSpellOnTarget(59126,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_30452', 599, 1)
end

function spell6_30452(pUnit, Event) --@Shadow Fissure,n/a--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(57579,pUnit:GetMainTank ())
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_30452', 1, 1)
end

function spell7_30452(pUnit, Event) --@Shadow Fissure,n/a--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(59127,pUnit:GetMainTank ())
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_30452', 1, 1)
end

function spell8_30452(pUnit, Event) --@Twilight Revenge,n/a--
pUnit:FullCastSpellOnTarget(60639,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_30452', 569, 1)
end

function Sorts_30452(pUnit, Event)
local choix_sorts_30452 = math.random(0, 8)
if choix_sorts_30452 == 0 then
pUnit:RegisterEvent('spell0_30452', 1, 1)
end
if choix_sorts_30452 == 1 then
pUnit:RegisterEvent('spell1_30452', 1, 1)
end
if choix_sorts_30452 == 2 then
pUnit:RegisterEvent('spell2_30452', 1, 1)
end
if choix_sorts_30452 == 3 then
pUnit:RegisterEvent('spell3_30452', 1, 1)
end
if choix_sorts_30452 == 4 then
pUnit:RegisterEvent('spell4_30452', 1, 1)
end
if choix_sorts_30452 == 5 then
pUnit:RegisterEvent('spell5_30452', 1, 1)
end
if choix_sorts_30452 == 6 then
pUnit:RegisterEvent('spell6_30452', 1, 1)
end
if choix_sorts_30452 == 7 then
pUnit:RegisterEvent('spell7_30452', 1, 1)
end
if choix_sorts_30452 == 8 then
pUnit:RegisterEvent('spell8_30452', 1, 1)
end
end

function mob30452_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_30452', math.random(1500, 3000), 1)
end

function mob30452_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob30452_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob30452_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(30452, 1, 'mob30452_Action')
RegisterUnitEvent(30452, 2, 'mob30452_Leave')
RegisterUnitEvent(30452, 3, 'mob30452_Kill')
RegisterUnitEvent(30452, 4, 'mob30452_Die')
